package com.ruoyi.produce.process.scheduling.mapper;

import com.ruoyi.produce.process.scheduling.domain.MachineScheduling;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MachineSchedulingMapper {
    /**
     * 查询所有设备的排产记录
     * @param machineScheduling
     * @return
     */
    List<MachineScheduling> selectMachineSchedulingList(MachineScheduling machineScheduling);

    /**
     * 根据设备查询其排产记录
     * @param machineId
     * @return
     */
    List<MachineScheduling> selectMachineSchedulingListByMachineId(String machineId);

    /**
     * 根据加工单编号查询设备排产记录
     * @param workSheetId
     * @return
     */
    MachineScheduling searchMachineSchedulingByWorkSheetId(String workSheetId);

    /**
     * 通过设备编号查询该设备目前最大的排产顺序
     * @param machineId
     * @return
     */
    MachineScheduling searchSchedulingMaxOrderByMachineId(String machineId);

    /**
     * 新增
     * @param machineScheduling
     * @return
     */
    int insertMachineScheduling(MachineScheduling machineScheduling);

    /**
     * 修改
     * @param machineScheduling
     * @return
     */
    int updateMachineScheduling(MachineScheduling machineScheduling);

    /**
     * 删除
     * @param machineScheduling
     * @return
     */
    int deleteMachineScheduling(MachineScheduling machineScheduling);

    /**
     * 改变设备排产记录的完成状态
     * @return
     */
    int updateCompletedStatus(@Param("machineId")String machineId, @Param("workSheetId")String workSheetId);
}
